package com.lilihub.miaosha.util;


import org.springframework.util.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @BelongsProject: miaosha2
 * @BelongsPackage: com.lilihub.miaosha.util
 * @Author: LiYing
 * @CreateTime: 2021-04-25 11:08
 * @Description:
 */
public class ValidateUtil {


    private static final Pattern phonePattern =  Pattern.compile("^[1][3,4,5,7,8][0-9]{9}$");

    public static boolean isPhone(String phone){

        Matcher matcher = phonePattern.matcher(phone);

        if (StringUtils.isEmpty(phone)){
            return false;
        }

        return matcher.matches();


    }



}
